/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pneuservis.backend.to;

import java.math.BigDecimal;
import pneuservis.backend.entities.TyreType;
import pneuservis.backend.others.Season;

/**
 *
 * @author Admin
 */
public class TyreTypeTO {
    private Long id;
    private int rimSize;
    private int width;
    private int profile;
    private Season season;
    private BigDecimal price;
    private String manufacturer;

    public TyreTypeTO() {
    }

    public TyreTypeTO(TyreType tyreType) {
        if (tyreType == null) {
            throw new IllegalArgumentException();
        }
        this.id = tyreType.getId();
        this.rimSize = tyreType.getRimSize();
        this.width = tyreType.getWidth();
        this.profile = tyreType.getProfile();
        this.season = tyreType.getSeason();
        this.price = tyreType.getPrice();
        this.manufacturer = tyreType.getManufacturer();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getRimSize() {
        return rimSize;
    }

    public void setRimSize(int rimSize) {
        this.rimSize = rimSize;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getProfile() {
        return profile;
    }

    public void setProfile(int profile) {
        this.profile = profile;
    }

    public Season getSeason() {
        return season;
    }

    public void setSeason(Season season) {
        this.season = season;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }
    
    public TyreType toTyreType() {
        TyreType result = new TyreType();
        result.setId(id);
        result.setManufacturer(manufacturer);
        result.setPrice(price);
        result.setProfile(profile);
        result.setRimSize(rimSize);
        result.setSeason(season);
        result.setWidth(width);
        return result;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 17 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TyreTypeTO other = (TyreTypeTO) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }
    
}
